<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex弹性布局-侧轴变主轴</title>
    <style>
        div {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            width: 800px;
            height: 650px;
            background-color: chartreuse;
        }

        div div {
            width: 200px;
            height: 200px;
            background-color: coral;
        }

        /* div div:nth-child(2) {
            align-self: flex-end;
        } */

        div div:nth-child(2n-1) {
            align-self: flex-start;
        }

        div div:nth-child(2n) {
            align-self: flex-end;
        }
    </style>
</head>
<body>
    <div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>
</html>